#include "crypt.h"

void crypt(QString mes, QString &res)
{
    res = "";
    const int keyLen = 19;
    int key[keyLen] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 13, 17, 31, 2, 3};
    for (int i = 0; i < mes.count(); ++i)
    {
        res.append((QChar)((unsigned char)(mes.at(i).toAscii()) ^ key[i % keyLen]));
    }
}

